<!--采购管理侧边栏-->
<li>
	<div class="link"><i class="fa fa-paint-brush"></i>供应商<i class="fa fa-chevron-down"></i></div>
	<ul class="submenu">
		<li>
			<a href="#">供应商登记</a>
		</li>
		<li>
			<a href="#">供应商移交</a>
		</li>
		<li>
			<a href="#">全部供应商</a>
		</li>
	</ul>
</li>
<li>
	<div class="link"><i class="fa fa-paint-brush"></i>采购<i class="fa fa-chevron-down"></i></div>
	<ul class="submenu">
		<li>
			<a href="#">采购单</a>
		</li>
		<li>
			<a href="#">采购单审核</a>
		</li>
		<li>
			<a href="#">采购单反审核</a>
		</li>
		<li>
			<a href="#">采购单一览表</a>
		</li>
	</ul>
</li>
<li>
	<div class="link"><i class="fa fa-paint-brush"></i>退货<i class="fa fa-chevron-down"></i></div>
	<ul class="submenu">
		<li>
			<a href="#">退货单</a>
		</li>
		<li>
			<a href="#">退货单审核</a>
		</li>
		<li>
			<a href="#">退货单反审核</a>
		</li>
		<li>
			<a href="#">退货单一览表</a>
		</li>
	</ul>
</li>
<li>
	<div class="link"><i class="fa fa-paint-brush"></i>对账<i class="fa fa-chevron-down"></i></div>
	<ul class="submenu">
		<li>
			<a href="#">采购对账</a>
		</li>
		<li>
			<a href="#">采购明细表</a>
		</li>
		<li>
			<a href="#">供应商采购汇总表</a>
		</li>
		<li>
			<a href="#">材料采购汇总表</a>
		</li>
	</ul>
</li>
<li>
	<div class="link"><i class="fa fa-paint-brush"></i>作废<i class="fa fa-chevron-down"></i></div>
	<ul class="submenu">
		<li>
			<a href="#">采购单作废</a>
		</li>
		<li>
			<a href="#">退货单作废</a>
		</li>
	</ul>
</li>
<script>
	//侧边导航栏
	$(function() {
		var Accordion = function(el, multiple) {
			this.el = el || {};
			this.multiple = multiple || false;

			// Variables privadas
			var links = this.el.find('.link');
			// Evento
			links.on('click', {
				el: this.el,
				multiple: this.multiple
			}, this.dropdown)
		}

		Accordion.prototype.dropdown = function(e) {
			var $el = e.data.el;
			$this = $(this),
				$next = $this.next();
			$next.slideToggle();
			$this.parent().toggleClass('open');

			if(!e.data.multiple) {
				$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
			};
		}

		var accordion = new Accordion($('.accordion'), false);
	});
</script>